package com.itdct.onflow.generator.template

import com.itdct.onflow.generator.base.BaseTemplate
import com.itdct.onflow.generator.config.GeneratorConfig
import com.itdct.onflow.generator.constant.GroupEnum
import com.itdct.onflow.generator.model.ClassModel
import com.itdct.onflow.generator.model.CompareResultModel

/**
 * @author Zhouwx
 * @date 2025/8/13 11:54:54
 * @version 1.0
 * @description
 */
class ManagerTemplate(classModel: ClassModel, generatorConfig: GeneratorConfig): BaseTemplate(classModel, generatorConfig) {
    override fun render(): String {
        return """
${uuidPrint()}
package ${classModel.packageName}.manager

import com.itdct.onflow.system.common.base.BaseManager
import org.springframework.stereotype.Component


/**
 * @author ${generatorConfig.authorName}
 * @date ${getDateString()}
 * @version 1.0
 * @description ${classModel.classUsage}中间层
 */
@Component
class ${classModel.className}Manager(
    val ${classModel.classNameLowCamel}Mapper: ${classModel.className}Mapper
) : BaseManager() {
    
}
        """.trimIndent()
    }

    override fun onModify(compareResultModel: CompareResultModel, content: String): String {
        return content
    }

    override fun belongGroup(): GroupEnum {
        return GroupEnum.BACKEND
    }

    override fun subModuleName(): String {
        return "adaptor"
    }

    override fun getFolderFileName(): String {
        return "manager/${classModel.className}Manager.kt"
    }

}